package sd.zhr.moodcapsule.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sd.zhr.moodcapsule.mapper.TagMapper;
import sd.zhr.moodcapsule.pojo.Tag;

import java.util.List;

@Service
public class TagServiceImpl {
    @Autowired
    TagMapper tagMapper;

    public List<Tag> findAll() {
        return tagMapper.selectAll();
    }
    public Tag findById(int id) {
        return tagMapper.selectByPrimaryKey(id);
    }
    public int save(Tag tag) {
        return tagMapper.insert(tag);
    }
    public int update(Tag tag) {
        return tagMapper.updateByPrimaryKey(tag);
    }
    public int delete(int id) {
        return tagMapper.deleteByPrimaryKey(id);
    }
}
